<?php
direct_url();
		$id=$_GET['id']; //string nha
		$db=new Model2;
		$id=mysql_real_escape_string($id);
		//-------------------------- GET TRUYEN ----------------
		$user=get_user_by_username($id);
		if($user){
		$r1=$db->fetchOne();
		$data['tag']=$user;
		$cache=new Cache;
		$sql ="select id from truyen where user_upload=".$id." order by id desc";
		
		$sql2="select id from truyen where user_upload= $id";
		$url=truyenf1_url_truyen_user($id).'/';
		$og_url=truyenf1_url_truyen_user($id);
		
		$pager = new Pagination2($sql,24,4,$url,0,'truyen_1');
		$pager->setDebug(false);
		$data['info'] = $pager->paginate($cache,$sql2);
		$data['nav']	= $pager->renderFullNav();
		}else{
			header('HTTP/1.0 404 Not Found');
			redirect(HOME.'404.html');
			die();
		}
	
		

	

	
			$data1['canonical']='<link rel="canonical" href="'.$og_url.'" /><meta name="ROBOTS" content="INDEX,NOFOLLOW"/>';
			$data1[title]=web_title('Truyện được đăng bởi '.show_username($user['username'],$user['name']));
			$data1['mota']='Những bộ truyện hay nhất được đăng bởi '.show_username($user['username'],$user['name']);
			$data1['keyword']=$id.',truyen dang boi '.$id.',truyen dang bỏi '.show_username($user['username'],$user['name']);
				
			loadview('template/header_truyen',$data1);
			loadview("truyen/list_user",$data);
			loadview('template/footer_truyen');
			exit();